- content_for :title do
  = @title

- content_for :section_title do
  = @title

- content_for :section_rightpanel do
  - if Setting.need_restart?
    button.btn.btn-icon.bg-warning[
      data-controller="admin-service"
      data-admin-service-target="button"
      data-admin-service-restarting-value="#{t('.service_restarting')}"
      data-admin-service-restarted-value="#{t('.service_restarted')}"
      data-action="admin-service#restart"
    ]
      i.icon.fas.fa-redo-alt
      = t('.apply_for_restart')

- @settings.each do |scope, keys|
  .row
    .col-md-12
      .card.system_info
        .card-header
          h3.card-title = t("admin.settings.#{scope}")
        .card-body
          - keys.each do |key, params|
            ruby:
              value = params[:value]
              if key == 'preset_schemes' && value&.blank?
                value = Setting.builtin_schemes
              end

              display_value = case value
                              when Hash
                                pretty_json(value)
                              when Array
                                value.join(', ')
                              when TrueClass
                                t('admin.settings.enable')
                              when FalseClass
                                t('admin.settings.disable')
                              else
                                value.blank? ? t('admin.settings.empty_value') : t("settings.#{key}.#{value}", default: value.to_s)
                              end
            dl.system-info
              dt = t("admin.settings.#{key}")
              dd
                - if params[:readonly] || (value.is_a?(Hash) && secure_key?(value))
                  pre.disabled.mb-2
                    == render 'switch_icon', value: value
                    = display_value
                - else
                  pre.mb-2
                    == render 'switch_icon', value: value
                    = link_to display_value, edit_admin_setting_path(key)

                - if hint = t("admin.settings.#{key}_hint", default: nil)
                  small.form-text.text-muted = hint